<?php

namespace App\Trip\Orders\BookOrders\Params\AbstractParam;

use App\Trip\Orders\BookOrders\Params\PassengersParam;
use Exception;

/**
 * 下单全量参数
 */
abstract class AbstractParam
{

    public function getParams(): array
    {
        return $this->params;
    }

    public function isIgnoreChangeWorkTimeError(): bool
    {
        $ignore_worktime_error = $this->params['ignore_worktime_error'] ?? 0;
        return $ignore_worktime_error == 1;
    }

    /**
     *  用户id
     *
     * @return string
     */
    public abstract function getUserId(): string;

    /**
     * 手机号
     *
     * @return string
     */
    public abstract function getMobile(): string;

    /**
     * 一般用于改签原单
     *
     * @return string
     * @throws Exception
     */
    public function getOriginOrderSn(): string
    {
        throw new Exception("当前订单非改签订单");
    }

    /**
     * 乘客参数
     *
     * @return PassengersParam
     */
    public abstract function getPassengersParam(): PassengersParam;
}